package com.jdbc.entity;

/**
 * @author wzm
 * @create 2023-04-07 14:45
 */
/*
* 表和java类的关系：
* 一个表对应着一个java的类（实体）   dog    Dog
* 一个表中的字段对应着java类中的属性 id id
* 一个表中的一条记录对应和java类的一个new的对象
*
* */
public class Dog {
    //属性
    private Integer id;
    private String name;
    private int age;
    private String sex;

    //typeid
    //private Integer typeId;
    //让Dog持有type的一个对象
    private Type type;


    //构造方法  get set toString

    public Dog() {
    }

    public Dog(String name, int age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public Dog(Integer id, String name, int age, String sex) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", type=" + type +
                '}';
    }
}
